package cn.mw.cmdb.enums;

/**
 *
 */
public enum ITSMAssetStateEnum {
    ASSET_INVENTORY ("mw_asset_status","2:入库"),
    ASSET_LISTING ("mw_asset_status","3:在用"),
    ASSET_DELISTING ("mw_asset_status","5:闲置"),
    ASSET_ACQUISITION("mw_asset_status","3:在用"),
    MW_USE_PEOPLE("mw_use_people","使用人"),
    ASSET_BORROWING("mw_asset_status","3:在用"),
    ASSET_RETURN("mw_asset_status","5:闲置"),
    /*ASSET_CHANGES("mw_asset_status","资产变更"),*/
    ASSET_REPAIR("mw_asset_status","6:维修"),
    ASSET_SCRAPPED("mw_asset_status","7:待报废"),
    ASSET_ARRIVAL("mw_asset_status","1:到货")
    ;

    private String key;
    private String stateName;
    ITSMAssetStateEnum(String key, String stateName){
        this.key = key;
        this.stateName = stateName;
    }
    public static String getCodeByName(String stateName) {
        for (ITSMAssetStateEnum value : ITSMAssetStateEnum.values()) {
            if (value.getStateName().equals(stateName)) {
                return value.getKey();
            }
        }
        return null;
    }
    public String getKey() {
        return key;
    }

    public String getStateName() {
        return stateName;
    }
}
